/****************************************************************************/
/* File: scs-color.h                                                        */
/* Desc: Specification file for the graphics color type                     */
/* Created: 2014-11-11                                                      */
/* Revised: 2014-11-12                                                      */
/* Authors: Sterling P. de Mille                                            */
/****************************************************************************/

// include once
#ifndef _SCS_COLOR_H_
#define _SCS_COLOR_H_

// core data types
#include "../Core/scs-types.h"
// C math  header file
#include <math.h>

// array access constants
const SCSint RED = 0;
const SCSint GREEN = 1;
const SCSint BLUE = 2;
const SCSint ALPHA = 3;

// graphics color type
class SCScolor {
protected:

	SCSfloat m_afValues[4];

	SCScolor GetPrimeColor (const SCSfloat fChroma, const SCSfloat fHue) const;
	SCSfloat GetMin () const;
	SCSfloat GetMax () const;

public:

	SCScolor ();
	SCScolor (const SCScolor& rkColor);
	SCScolor (const SCSfloat fShade, const SCSfloat fAlpha = 1);
	SCScolor (const SCSfloat fRed, const SCSfloat fGreen, const SCSfloat fBlue, const SCSfloat fAlpha = 1);

	~SCScolor ();

	SCSfloat GetRed () const;
	SCSfloat GetGreen () const;
	SCSfloat GetBlue () const;
	SCSfloat GetAlpha () const;

	SCSint8u GetColor2222 () const;
	SCSint16u GetColor565 () const;
	SCSint32u GetColor8888 () const;

	void SetRed (const SCSfloat fRed);
	void SetGreen (const SCSfloat fGreen);
	void SetBlue (const SCSfloat fBlue);
	void SetAlpha (const SCSfloat fAlpha);

	SCScolor Add (const SCScolor& rkColor) const;

	SCSfloat GetHue () const;
	SCSfloat GetChroma () const;
	SCSfloat GetValue () const;
	SCSfloat GetLightness () const;
	SCSfloat GetLuma () const;
	SCSfloat GetGrayscale () const;
	SCSfloat GetSaturationHSV () const;
	SCSfloat GetSaturationHSL () const;
	SCSfloat GetTransparency () const;

	void SetHue (const SCSfloat fHue);
	void SetSaturation (const SCSfloat fSaturation);
	void SetValue (const SCSfloat fValue);
	void SetLightness (const SCSfloat fLightness);
	void SetTransparency (const SCSfloat fTransparency);

	void SetColor (const SCScolor& rkColor);
	void SetShade (const SCSfloat fShade, const SCSfloat fAlpha = 1);
	void SetRGB (const SCSfloat fRed, const SCSfloat fGreen, const SCSfloat fBlue, const SCSfloat fAlpha = 1);
	void SetHSV (const SCSfloat fHue, const SCSfloat fSaturation, const SCSfloat fValue, const SCSfloat fTransparency = 1);
	void SetHSL (const SCSfloat fHue, const SCSfloat fSaturation, const SCSfloat fLightness, const SCSfloat fTransparency = 1);
	void SetHCL (const SCSfloat fHue, const SCSfloat fChroma, const SCSfloat fLuma, const SCSfloat fTransparency = 1);
};

#endif // _SCS_COLOR_H_
